/**
 * 
 */
package com.dsteiner.gwt.cafeteriasophia.client.model;

import java.beans.PropertyChangeListener;

import com.dsteiner.gwt.cafeteriasophia.client.domain.Purchase;
import com.dsteiner.widgets.client.PropertyChangeCollection;

public class PurchaseModel {
	private PropertyChangeCollection propertyChangeSupport = new PropertyChangeCollection(
			this);
	
	public void addPropertyChangeListener(String propertyName,
			PropertyChangeListener listener) {
		propertyChangeSupport.registerPropertyChangeListener(
				propertyName, listener);
	}
	
	private Purchase purchase;

	public Purchase getPurchase() {
		return purchase;
	}

	public void setPurchase(Purchase purchase) {
		Purchase oldPurchase = this.purchase;
		this.purchase = purchase;
		propertyChangeSupport.firePropertyChange("purchase", oldPurchase, purchase);
	}
}